package com.zhangxiaofanfan.hotcode.second;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 *
 * @author zhangxiaofanfan
 * @date 2024-06-03 23:26:00
 */
public class HotCode043 {
    public static void main(String[] args) {

    }

    private Map<TreeNode, int[]> map = new HashMap<>();
    public boolean isValidBST(TreeNode root) {
        if (root == null) {
            return true;
        }
        if (root.left != null) {
            if (isValidBST(root.left)) {

            } else {
                return false;
            }
        }
        if (root.right != null) {
            if (isValidBST(root.right)) {

            } else {
                return false;
            }
        }
        return true;
    }

    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode() {
        }

        TreeNode(int val) {
            this.val = val;
        }

        TreeNode(int val, TreeNode left, TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }
}
